package com.example.Lambda;

public class Test2Lambda {
    public static void main(String[] args) {
        useShowHandler(new ShowHandler() {
            @Override
            public void show() {
                System.out.println("匿名内部类中的show方法");
            }
        });

        //Lambda实现
        useShowHandler(() -> {System.out.println("Lambda中的show方法");});
    }

    public static void useShowHandler(ShowHandler showHandler) {
        showHandler.show();
    }
}

interface ShowHandler {
    void show();
}
